/*
 * @Date: 2020-02-17 09:45:24
 * @LastEditors: peng qiao
 * @LastEditTime: 2020-03-29 13:21:34
 */
import http from './Common/http.js'
import constant from '@/controller/constant.js'

export default {
  // 社区概况
  neighborhood_detail_v1_get: async function (id) {
    const res = await http.get(constant.BASE_URL + '/neighborhoodDetail/v1/get/'+id)
    return res
  },
  // 分页查询小区设备
  community_community_facility_page: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/communityFacility/page', data)
    return res
  },
  // 小区设备详情
  community_community_facility_id: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/communityFacility/'+id)
    return res
  },
  // 新增物业报修
  community_repair_apply: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/repairApply', data)
    return res
  },
  // 报修类型列表
  community_repair_type_get_all: async function () {
    const res = await http.get(constant.BASE_URL + '/community/repairType/getAll')
    return res
  },
  // 报修类型列表
  community_repair_type_get_by_neighborhoodId: async function (neighborhoodId) {
    const res = await http.get(constant.BASE_URL + `/community/repairType/neighborhood/${neighborhoodId}`)
    return res
  },
  // 我的报修列表查询
  community_repair_apply_page: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/repairApply/page', data)
    return res
  },
  // 取消报修
  community_repair_apply_cancel: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/repairApply/cancel/'+id)
    return res
  },
  // 删除报修
  community_repair_apply_ids: async function (ids) {
    const res = await http.post(constant.BASE_URL + '/community/repairApply/ids', ids)
    return res
  },
  // 我的小区查询
  community_user_house_neighborhood_current: async function (neighborhoodId) {
    const res = await http.post(constant.BASE_URL + `/community/userHouse/neighborhood/current/${neighborhoodId}`)
    return res
  },
  // 新增访客
  community_visitor_record: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/visitorRecord/app', data)
    return res
  },
  // 修改访客
  community_visitor_record_edit: async function (data) {
    const res = await http.put(constant.BASE_URL + '/community/visitorRecord', data)
    return res
  },
  // 访客列表查询
  community_visitor_record_page: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/visitorRecord/pageYear', data)
    return res
  },
  // 删除访客
  community_visitor_record_ids: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/visitorRecord/ids', data)
    return res
  },
  // 查询缴费组
  community_payment_group_list: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/paymentGroup/list', data)
    return res
  },
  // 获取所有缴费项
  community_payment_item_all: async function () {
    const res = await http.get(constant.BASE_URL + '/community/paymentItem/getAll')
    return res
  },
  // 获取缴费项详情
  community_payment_item_id: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/paymentItem/'+id)
    return res
  },
  // 删除缴费项
  community_payment_group_item_delete: async function (id) {
    const res = await http.delete(constant.BASE_URL + '/community/paymentGroupItem/'+id)
    return res
  },
  // 新增缴费组项
  community_payment_group_item_create: async function (data) {
    const res = await http.put(constant.BASE_URL + '/community/paymentGroupItem/', data)
    return res
  },
  // 修改缴费组项
  community_payment_group_item_modify: async function (data) {
    const res = await http.put(constant.BASE_URL + '/community/paymentGroupItem/', data)
    return res
  },
  // 缴费表单详情
  community_payment_group_item: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/paymentGroupItem/'+id)
    return res
  },
  // 新增缴费
  community_payment_record: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/paymentRecord', data)
    return res
  },
  // 分页查询缴费记录
  community_payment_record_page: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/paymentRecord/page', data)
    return res
  },
  // 删除缴费组
  community_payment_group_delete: async function (data) {
    const res = await http.delete(constant.BASE_URL + '/community/paymentGroup/'+data)
    return res
  },
  // 新增缴费组
  community_payment_group_create: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/paymentGroup', data)
    return res
  },
  // 修改缴费组
  community_payment_group_modify: async function (data) {
    const res = await http.put(constant.BASE_URL + '/community/paymentGroup', data)
    return res
  },
}